# import nltk
# from nltk import ConditionalFreqDist
# import jieba
#
# # 示例文本
# text = "春搜驰骏骨，飘珠箔穿露。"
# # jieba分词
# tokens = jieba.cut(text)
# # 生成bigrams
# bi_grams = nltk.ngrams(tokens, 2)
# # 计算频率分布
# cfd = ConditionalFreqDist(bi_grams)
#
# test_text = "你不是学生"
# # 分词
# test_tokens = list(jieba.cut(test_text))
# # 计算频率分布
# P = 1.0
# for i, x in enumerate(test_tokens):
#     if i == len(test_tokens) - 1:
#         continue
#     P *= cfd[x].freq(test_tokens[i + 1])
# print(P) # 0.5

import jieba
seg_list = jieba.cut("春搜驰骏骨，飘珠箔穿露。", cut_all=False)
print("Default Mode: " + "/ ".join(seg_list))  # 精确模式
